import React, { memo, Suspense } from 'react'
import { HashRouter, withRouter } from 'react-router-dom'
import { renderRoutes } from 'react-router-config'
import routes from './router'

// 组件
import AppHeader from './components/app-header'
import AppFooter from './components/app-footer'
// 加载组件
import AppLoading from './components/app-loading/app-loading'

// redux
// import { Provider } from 'react-redux'
// import store from './store'


// return (
//   <Provider store={store}>
//     <HashRouter>
//       <AppHeader />
//       <Suspense fallback={<AppLoading />}>
//         {renderRoutes(routes)}
//       </Suspense>
//       <AppFooter />
//     </HashRouter>
//   </Provider>
// )

function App() {

  return (
    <>
      <AppHeader />
      <Suspense fallback={<AppLoading />}>
        {renderRoutes(routes)}
      </Suspense>
      <AppFooter />
    </>
  )
}

export default memo(App)
